# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Compute.V1.Model.SecurityPolicyRuleMatcher do
  @moduledoc """
  Represents a match condition that incoming traffic is evaluated against. Exactly one field must be specified.

  ## Attributes

  *   `config` (*type:* `GoogleApi.Compute.V1.Model.SecurityPolicyRuleMatcherConfig.t`, *default:* `nil`) - The configuration options available when specifying versioned_expr. This field must be specified if versioned_expr is specified and cannot be specified if versioned_expr is not specified.
  *   `expr` (*type:* `GoogleApi.Compute.V1.Model.Expr.t`, *default:* `nil`) - User defined CEVAL expression. A CEVAL expression is used to specify match criteria such as origin.ip, source.region_code and contents in the request header. Expressions containing `evaluateThreatIntelligence` require Cloud Armor Managed Protection Plus tier and are not supported in Edge Policies nor in Regional Policies. Expressions containing `evaluatePreconfiguredExpr('sourceiplist-*')` require Cloud Armor Managed Protection Plus tier and are only supported in Global Security Policies.
  *   `exprOptions` (*type:* `GoogleApi.Compute.V1.Model.SecurityPolicyRuleMatcherExprOptions.t`, *default:* `nil`) - The configuration options available when specifying a user defined CEVAL expression (i.e., 'expr').
  *   `versionedExpr` (*type:* `String.t`, *default:* `nil`) - Preconfigured versioned expression. If this field is specified, config must also be specified. Available preconfigured expressions along with their requirements are: SRC_IPS_V1 - must specify the corresponding src_ip_range field in config.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :config => GoogleApi.Compute.V1.Model.SecurityPolicyRuleMatcherConfig.t() | nil,
          :expr => GoogleApi.Compute.V1.Model.Expr.t() | nil,
          :exprOptions =>
            GoogleApi.Compute.V1.Model.SecurityPolicyRuleMatcherExprOptions.t() | nil,
          :versionedExpr => String.t() | nil
        }

  field(:config, as: GoogleApi.Compute.V1.Model.SecurityPolicyRuleMatcherConfig)
  field(:expr, as: GoogleApi.Compute.V1.Model.Expr)
  field(:exprOptions, as: GoogleApi.Compute.V1.Model.SecurityPolicyRuleMatcherExprOptions)
  field(:versionedExpr)
end

defimpl Poison.Decoder, for: GoogleApi.Compute.V1.Model.SecurityPolicyRuleMatcher do
  def decode(value, options) do
    GoogleApi.Compute.V1.Model.SecurityPolicyRuleMatcher.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Compute.V1.Model.SecurityPolicyRuleMatcher do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
